const path = require('path')
const { VueLoaderPlugin } = require('vue-loader')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
    entry:'./src/main.js',
    output: {
        filename:'main.js',
        path:path.resolve(__dirname,'dist')
    },
    module: {
        rules:[
            {
                test:/\.vue$/,
                use: 'vue-loader'
            },
            {
                test:/\.less$/,
                use: ['style-loader','css-loader','less-loader']
            },
            {
                test:/.\js$/,
                exclude:/node_modules/,
                use: ['babel-loader','eslint-loader']
            },
            {
                test:/\.css/,
                use: ['style-loader','css-loader']
            },
            {
                test: /\.(png|svg|jpg|jpeg|gif)$/i,
                type: 'asset/resource',
              }

        ]
    }, 
    plugins: [
       new VueLoaderPlugin(),
       new HtmlWebpackPlugin({
           template:path.resolve(__dirname,'public/index.html'),
           filename:'index.html'
       }),
    ]
}